package com.nopay.dxdwphone.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.widget.ProgressBar;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.github.ybq.android.spinkit.sprite.Sprite;
import com.github.ybq.android.spinkit.style.Circle;

import com.nopay.dxdwphone.R;

/**
 * 联系客服
 */
public class DialogDownload extends Dialog {

    public DialogDownload(@NonNull Activity context) {
        super(context, R.style.MyDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_download);
        setCanceledOnTouchOutside(false);

        ProgressBar progressBar = findViewById(R.id.spin_kit);
        Sprite threeBounce = new Circle();
        progressBar.setIndeterminateDrawable(threeBounce);
    }

    public void show() {
        super.show();
        setProgress(0);
    }

    public void setProgress(int progress) {
        TextView tv_loading = findViewById(R.id.tv_progress);
        tv_loading.setText(progress + " %");
    }
}



